# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 0
n 0(None)[return self.get_item_list('options_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75ba70c>}
nname: 0
n 0(None)[return self.get_item_list('main_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75babec>}
nname: 0
n 0(None)[return self.get_item_list('focus_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75ba26c>}
nname: 631
n 631(None)[Task(self.choices.advertise).start(0)
]:
	i: 616(), 630()
	o: 

nname: 630
n 630(None)[]:
	i: 560(f)
	o: 631()

nname: 616
n 616(None)[self._set_options_list()
]:
	i: 560(t)
	o: 631()

nname: 560
n 560(len(self.available_choices) == 2)[self.set_items([], list_name='options_list')
]:
	i: 240(), 516()
	o: 616(t), 630(f)

nname: 516
n 516(None)[self.set_items(self.actiongroup_list, list_name='focus_list', position=-1)
self.select(selected_item, 'focus_list')
]:
	i: 439(AL), 515()
	o: 560()

nname: 515
n 515(None)[]:
	i: 461(AF), 512()
	o: 516()

nname: 512
n 512(None)[]:
	i: 502(JA), 511()
	o: 515()

nname: 511
n 511(None)[]:
	i: 471(f), 507()
	o: 512()

nname: 507
n 507(None)[continue
]:
	i: 483(f)
	o: 511()

nname: 502
n 502(None)[break
]:
	i: 483(t)
	o: 512(JA)

nname: 483
n 483(it in default_items)[]:
	i: 471(t)
	o: 502(t), 507(f)

nname: 471
n 471(it.sensitive)[for it in self.actiongroup_list:
]:
	i: 461(for)
	o: 483(t), 511(f)

nname: 461
n 461(None)[]:
	i: 439(loop)
	o: 471(for), 515(AF)

nname: 439
n 439(None)[del _[2]
for marker_items in self.actiongroup_list:
]:
	i: 377(AF), 435()
	o: 461(loop), 516(AL)

nname: 435
n 435(None)[]:
	i: 400(f), 424()
	o: 439()

nname: 424
n 424(None)[continue
]:
	i: 400(t)
	o: 435()

nname: 400
n 400('marker' in g.name.lower())[for g in self.actiongroup_list:
]:
	i: 377(for)
	o: 424(t), 435(f)

nname: 377
n 377(None)[del _[1]
for default_items in self.actiongroup_list:
]:
	i: 314(AF), 373()
	o: 400(for), 439(AF)

nname: 373
n 373(None)[]:
	i: 350(f), 362()
	o: 377()

nname: 362
n 362(None)[continue
]:
	i: 350(t)
	o: 373()

nname: 350
n 350(g.default)[for g in self.actiongroup_list:
]:
	i: 314(for)
	o: 362(t), 373(f)

nname: 314
n 314(None)[self.available_choices = ['focus_list', 'main_list', 'options_list']
]:
	i: 101&223(f)
	o: 350(for), 377(AF)

nname: 240
n 240(None)[_[1], _[2], selected_item, self._active_list, selected_item, self.available_choices = [], [], self.actiongroup_list[0], self.available_choices[0], it, ['main_list', 'options_list']
self.set_items(self.actiongroup_list[0].browse(self.context))
del self._getitems_keywords['focus_list']
self.select(0)
]:
	i: 101&223(t)
	o: 560()

nname: 101&223
n 101&223(len(self.actiongroup_list) == 1 and self.actiongroup_list[0].unique)[from pygui.actions import get_actiongroups_by_category
self.actiongroup_list = get_actiongroups_by_category(self.context, category)
self._getitems_keywords.update(dict(focus_list=(lambda : self.get_item_list('focus_list')), main_list=(lambda : self.get_item_list('main_list')), options_list=(lambda : self.get_item_list('options_list'))))
]:
	i: 83(), 100()
	o: 240(t), 314(f)

nname: 100
n 100(None)[]:
	i: 0(f)
	o: 101&223()

nname: 83
n 83(None)[self.context['hand_menu'] = self
]:
	i: 0(t)
	o: 101&223()

nname: 0
n 0('hand_menu' not in self.context)[from pygui.eventmanager.menus import ActionMenuEventHandler
self.eventhandler = ActionMenuEventHandler(self)
ContextMenu.__init__(self, 'Hand menu', [], type=type_, **kw)
self.context = context
]:
	i: 
	o: 83(t), 100(f)

nname: 560
n 560(None)[self.set_items([], list_name='options_list')
if len(self.available_choices) == 2:
	self._set_options_list()
Task(self.choices.advertise).start(0)
]:
	i: 240(), 516()
	o: 

nname: 516
n 516(None)[self.set_items(self.actiongroup_list, list_name='focus_list', position=-1)
self.select(selected_item, 'focus_list')
]:
	i: 439(AL), 461(AF), 502(JA), 471(f), 507()
	o: 560()

nname: 507
n 507(None)[continue
]:
	i: 483(f)
	o: 516()

nname: 502
n 502(None)[break
]:
	i: 483(t)
	o: 516(JA)

nname: 483
n 483(it in default_items)[]:
	i: 471(t)
	o: 502(t), 507(f)

nname: 471
n 471(it.sensitive)[for it in self.actiongroup_list:
]:
	i: 461(for)
	o: 483(t), 516(f)

nname: 461
n 461(None)[]:
	i: 439(loop)
	o: 471(for), 516(AF)

nname: 439
n 439(None)[del _[2]
for marker_items in self.actiongroup_list:
]:
	i: 377(AF), 400()
	o: 461(loop), 516(AL)

nname: 400
n 400(None)[for g in self.actiongroup_list:
if 'marker' in g.name.lower():
	continue
]:
	i: 377(for)
	o: 439()

nname: 377
n 377(None)[del _[1]
for default_items in self.actiongroup_list:
]:
	i: 314(AF), 350()
	o: 400(for), 439(AF)

nname: 350
n 350(None)[for g in self.actiongroup_list:
if g.default:
	continue
]:
	i: 314(for)
	o: 377()

nname: 314
n 314(None)[self.available_choices = ['focus_list', 'main_list', 'options_list']
]:
	i: 0(f)
	o: 350(for), 377(AF)

nname: 240
n 240(None)[_[1], _[2], selected_item, self._active_list, selected_item, self.available_choices = [], [], self.actiongroup_list[0], self.available_choices[0], it, ['main_list', 'options_list']
self.set_items(self.actiongroup_list[0].browse(self.context))
del self._getitems_keywords['focus_list']
self.select(0)
]:
	i: 0(t)
	o: 560()

nname: 0
n 0(len(self.actiongroup_list) == 1 and self.actiongroup_list[0].unique)[from pygui.eventmanager.menus import ActionMenuEventHandler
self.eventhandler = ActionMenuEventHandler(self)
ContextMenu.__init__(self, 'Hand menu', [], type=type_, **kw)
self.context = context
if 'hand_menu' not in self.context:
	self.context['hand_menu'] = self
from pygui.actions import get_actiongroups_by_category
self.actiongroup_list = get_actiongroups_by_category(self.context, category)
self._getitems_keywords.update(dict(focus_list=(lambda : self.get_item_list('focus_list')), main_list=(lambda : self.get_item_list('main_list')), options_list=(lambda : self.get_item_list('options_list'))))
]:
	i: 
	o: 240(t), 314(f)

nname: 560
n 560(None)[self.set_items([], list_name='options_list')
if len(self.available_choices) == 2:
	self._set_options_list()
Task(self.choices.advertise).start(0)
]:
	i: 240(), 471()
	o: 

nname: 471
n 471(None)[for it in self.actiongroup_list:
	if it.sensitive:
		if it in default_items:
			break
		else:
			continue
self.set_items(self.actiongroup_list, list_name='focus_list', position=-1)
self.select(selected_item, 'focus_list')
]:
	i: 439(for)
	o: 560()

nname: 439
n 439(None)[del _[2]
for marker_items in self.actiongroup_list:
]:
	i: 377(AF), 400()
	o: 471(for)

nname: 400
n 400(None)[for g in self.actiongroup_list:
if 'marker' in g.name.lower():
	continue
]:
	i: 377(for)
	o: 439()

nname: 377
n 377(None)[del _[1]
for default_items in self.actiongroup_list:
]:
	i: 314(AF), 350()
	o: 400(for), 439(AF)

nname: 350
n 350(None)[for g in self.actiongroup_list:
if g.default:
	continue
]:
	i: 314(for)
	o: 377()

nname: 314
n 314(None)[self.available_choices = ['focus_list', 'main_list', 'options_list']
]:
	i: 0(f)
	o: 350(for), 377(AF)

nname: 240
n 240(None)[_[1], _[2], selected_item, self._active_list, selected_item, self.available_choices = [], [], self.actiongroup_list[0], self.available_choices[0], it, ['main_list', 'options_list']
self.set_items(self.actiongroup_list[0].browse(self.context))
del self._getitems_keywords['focus_list']
self.select(0)
]:
	i: 0(t)
	o: 560()

nname: 0
n 0(len(self.actiongroup_list) == 1 and self.actiongroup_list[0].unique)[from pygui.eventmanager.menus import ActionMenuEventHandler
self.eventhandler = ActionMenuEventHandler(self)
ContextMenu.__init__(self, 'Hand menu', [], type=type_, **kw)
self.context = context
if 'hand_menu' not in self.context:
	self.context['hand_menu'] = self
from pygui.actions import get_actiongroups_by_category
self.actiongroup_list = get_actiongroups_by_category(self.context, category)
self._getitems_keywords.update(dict(focus_list=(lambda : self.get_item_list('focus_list')), main_list=(lambda : self.get_item_list('main_list')), options_list=(lambda : self.get_item_list('options_list'))))
]:
	i: 
	o: 240(t), 314(f)

nname: 560
n 560(None)[self.set_items([], list_name='options_list')
if len(self.available_choices) == 2:
	self._set_options_list()
Task(self.choices.advertise).start(0)
]:
	i: 240(), 439()
	o: 

nname: 439
n 439(None)[del _[2]
for marker_items in self.actiongroup_list:
for it in self.actiongroup_list:
	if it.sensitive:
		if it in default_items:
			break
		else:
			continue
self.set_items(self.actiongroup_list, list_name='focus_list', position=-1)
self.select(selected_item, 'focus_list')
]:
	i: 377(AF), 400()
	o: 560()

nname: 400
n 400(None)[for g in self.actiongroup_list:
if 'marker' in g.name.lower():
	continue
]:
	i: 377(for)
	o: 439()

nname: 377
n 377(None)[del _[1]
for default_items in self.actiongroup_list:
]:
	i: 314(AF), 350()
	o: 400(for), 439(AF)

nname: 350
n 350(None)[for g in self.actiongroup_list:
if g.default:
	continue
]:
	i: 314(for)
	o: 377()

nname: 314
n 314(None)[self.available_choices = ['focus_list', 'main_list', 'options_list']
]:
	i: 0(f)
	o: 350(for), 377(AF)

nname: 240
n 240(None)[_[1], _[2], selected_item, self._active_list, selected_item, self.available_choices = [], [], self.actiongroup_list[0], self.available_choices[0], it, ['main_list', 'options_list']
self.set_items(self.actiongroup_list[0].browse(self.context))
del self._getitems_keywords['focus_list']
self.select(0)
]:
	i: 0(t)
	o: 560()

nname: 0
n 0(len(self.actiongroup_list) == 1 and self.actiongroup_list[0].unique)[from pygui.eventmanager.menus import ActionMenuEventHandler
self.eventhandler = ActionMenuEventHandler(self)
ContextMenu.__init__(self, 'Hand menu', [], type=type_, **kw)
self.context = context
if 'hand_menu' not in self.context:
	self.context['hand_menu'] = self
from pygui.actions import get_actiongroups_by_category
self.actiongroup_list = get_actiongroups_by_category(self.context, category)
self._getitems_keywords.update(dict(focus_list=(lambda : self.get_item_list('focus_list')), main_list=(lambda : self.get_item_list('main_list')), options_list=(lambda : self.get_item_list('options_list'))))
]:
	i: 
	o: 240(t), 314(f)

self.nodes: {0: <unpyclib.structure.node instance at 0xb75ab26c>, 400: <unpyclib.structure.node instance at 0xb75ab28c>, 560: <unpyclib.structure.node instance at 0xb75ab5cc>, 439: <unpyclib.structure.node instance at 0xb75ab4cc>, 314: <unpyclib.structure.node instance at 0xb75a5bac>, 350: <unpyclib.structure.node instance at 0xb75abbac>, 240: <unpyclib.structure.node instance at 0xb75a5f6c>, 377: <unpyclib.structure.node instance at 0xb75b702c>}
nname: 65
n 65(None)[self.set_items([], list_name='main_list', position=-1)
]:
	i: 42(), 61()
	o: 

nname: 61
n 61(None)[]:
	i: 0(f)
	o: 65()

nname: 42
n 42(None)[]:
	i: 0(t)
	o: 65()

nname: 0
n 0(selection.is_available(self.context))[selection = self.get_item_list('focus_list').selected
]:
	i: 
	o: 42(t), 61(f)

nname: 0
n 0(None)[selection = self.get_item_list('focus_list').selected
if selection.is_available(self.context):
	pass
self.set_items([], list_name='main_list', position=-1)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb759bf8c>}
nname: 71
n 71(None)[return ret
]:
	i: 56(), 70()
	o: 

nname: 70
n 70(None)[]:
	i: 13&43(f)
	o: 71()

nname: 56
n 56(None)[self._set_action_list()
]:
	i: 13&43(t)
	o: 71()

nname: 13&43
n 13&43(ret and list_name == 'focus_list')[list_name = list_name
ret = ContextMenu.select(self, item, list_name)
]:
	i: 0(t), 6()
	o: 56(t), 70(f)

nname: 6
n 6(None)[]:
	i: 0(f)
	o: 13&43()

nname: 0
n 0(list_name)[]:
	i: 
	o: 6(f), 13&43(t)

nname: 71
n 71(None)[return ret
]:
	i: 0()
	o: 

nname: 0
n 0(None)[if not list_name:
	pass
list_name = list_name
ret = ContextMenu.select(self, item, list_name)
if ret and list_name == 'focus_list':
	self._set_action_list()
]:
	i: 
	o: 71()

nname: 0
n 0(None)[if not list_name:
	pass
list_name = list_name
ret = ContextMenu.select(self, item, list_name)
if ret and list_name == 'focus_list':
	self._set_action_list()
return ret
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb759bf6c>}
nname: 87
n 87(None)[]:
	i: 59(JA), 82(), 86()
	o: 

nname: 86
n 86(None)[]:
	i: 0(f)
	o: 87()

nname: 82
n 82(None)[]:
	i: 24(f)
	o: 87()

nname: 59
n 59(None)[self.set_items([], list_name='options_list')
]:
	i: 24(t)
	o: 87(JA)

nname: 24
n 24(self._active_list == 'focus_list')[self.get_item_list(old_al).select()
]:
	i: 0(t)
	o: 59(t), 82(f)

nname: 0
n 0(ContextMenu.focus_previous(self))[old_al = self._active_list
]:
	i: 
	o: 24(t), 86(f)

nname: 0
n 0(None)[old_al = self._active_list
if ContextMenu.focus_previous(self):
	self.get_item_list(old_al).select()
	if self._active_list == 'focus_list':
		self.set_items([], list_name='options_list')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb759bfac>}
nname: 6
n 6(None)[__doc__ = " Defines 'Action' (aka 'hand') menus, to access everything "
name = _('Hand')
def __init__(self, context, type_='action', category='navigator', **kw):
	from pygui.eventmanager.menus import ActionMenuEventHandler
	self.eventhandler = ActionMenuEventHandler(self)
	ContextMenu.__init__(self, 'Hand menu', [], type=type_, **kw)
	self.context = context
	if 'hand_menu' not in self.context:
		self.context['hand_menu'] = self
	from pygui.actions import get_actiongroups_by_category
	self.actiongroup_list = get_actiongroups_by_category(self.context, category)
	self._getitems_keywords.update(dict(focus_list=(lambda : self.get_item_list('focus_list')), main_list=(lambda : self.get_item_list('main_list')), options_list=(lambda : self.get_item_list('options_list'))))

def _set_action_list(self):
	selection = self.get_item_list('focus_list').selected
	if selection.is_available(self.context):
		pass
	self.set_items([], list_name='main_list', position=-1)

def select(self, item, list_name=None):
	if not list_name:
		pass
	list_name = list_name
	ret = ContextMenu.select(self, item, list_name)
	if ret and list_name == 'focus_list':
		self._set_action_list()
	return ret

def focus_previous(self):
	old_al = self._active_list
	if ContextMenu.focus_previous(self):
		self.get_item_list(old_al).select()
		if self._active_list == 'focus_list':
			self.set_items([], list_name='options_list')

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb759b92c>}
nname: 0
n 0(None)[from __future__ import absolute_import
__all__ = ['ActionMenu']
from .core import ContextMenu
from peewee.notifier import Task
class ActionMenu(ContextMenu):
	__doc__ = " Defines 'Action' (aka 'hand') menus, to access everything "
	name = _('Hand')
	def __init__(self, context, type_='action', category='navigator', **kw):
		from pygui.eventmanager.menus import ActionMenuEventHandler
		self.eventhandler = ActionMenuEventHandler(self)
		ContextMenu.__init__(self, 'Hand menu', [], type=type_, **kw)
		self.context = context
		if 'hand_menu' not in self.context:
			self.context['hand_menu'] = self
		from pygui.actions import get_actiongroups_by_category
		self.actiongroup_list = get_actiongroups_by_category(self.context, category)
		self._getitems_keywords.update(dict(focus_list=(lambda : self.get_item_list('focus_list')), main_list=(lambda : self.get_item_list('main_list')), options_list=(lambda : self.get_item_list('options_list'))))

	def _set_action_list(self):
		selection = self.get_item_list('focus_list').selected
		if selection.is_available(self.context):
			pass
		self.set_items([], list_name='main_list', position=-1)

	def select(self, item, list_name=None):
		if not list_name:
			pass
		list_name = list_name
		ret = ContextMenu.select(self, item, list_name)
		if ret and list_name == 'focus_list':
			self._set_action_list()
		return ret

	def focus_previous(self):
		old_al = self._active_list
		if ContextMenu.focus_previous(self):
			self.get_item_list(old_al).select()
			if self._active_list == 'focus_list':
				self.set_items([], list_name='options_list')



]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7594f2c>}
from __future__ import absolute_import
__all__ = ['ActionMenu']
from .core import ContextMenu
from peewee.notifier import Task
class ActionMenu(ContextMenu):
	__doc__ = " Defines 'Action' (aka 'hand') menus, to access everything "
	name = _('Hand')
	def __init__(self, context, type_='action', category='navigator', **kw):
		from pygui.eventmanager.menus import ActionMenuEventHandler
		self.eventhandler = ActionMenuEventHandler(self)
		ContextMenu.__init__(self, 'Hand menu', [], type=type_, **kw)
		self.context = context
		if 'hand_menu' not in self.context:
			self.context['hand_menu'] = self
		from pygui.actions import get_actiongroups_by_category
		self.actiongroup_list = get_actiongroups_by_category(self.context, category)
		self._getitems_keywords.update(dict(focus_list=(lambda : self.get_item_list('focus_list')), main_list=(lambda : self.get_item_list('main_list')), options_list=(lambda : self.get_item_list('options_list'))))

	def _set_action_list(self):
		selection = self.get_item_list('focus_list').selected
		if selection.is_available(self.context):
			pass
		self.set_items([], list_name='main_list', position=-1)

	def select(self, item, list_name=None):
		if not list_name:
			pass
		list_name = list_name
		ret = ContextMenu.select(self, item, list_name)
		if ret and list_name == 'focus_list':
			self._set_action_list()
		return ret

	def focus_previous(self):
		old_al = self._active_list
		if ContextMenu.focus_previous(self):
			self.get_item_list(old_al).select()
			if self._active_list == 'focus_list':
				self.set_items([], list_name='options_list')



